#ifndef __WINNETWORK_H__
# define __WINNETWORK_H__

# include <Winsock2.h>

typedef	SOCKET	handle;

# include "INetwork.h"

class			winNetwork : public INetwork
{
public:
	winNetwork(int domain, int type, int protocol, const char *ip, int port, int backlog);
	winNetwork(const winNetwork &);
	~winNetwork(void);
	winNetwork	&operator=(const winNetwork &);
	bool		createSocket(void);
	bool		closeSocket(handle socket = INVALID_SOCKET);
	bool		bindNetwork(void);
	bool		listenNetwork(void);
	bool		acceptNetwork(handle *);
	bool		selectNetwork(int*, int, fd_set*, fd_set*, fd_set*, struct timeval*);
	bool		initialize(void);

private:
	handle		_socket;
	int			_domain;
	int			_type;
	int			_protocol;
	const char	*_ip;
	int			_port;
	int			_backlog;
};

#endif // __WINNETWORK_H__
